import type { Params } from "@/types/common"
import { $baseApi } from "@/utils/http-instance"

// 支付流水
export const $getStmtDetail = (stmtId: string) => {
	return $baseApi.get(`hy-stmts/get/${stmtId}`)
}
//线下付
export const $shopOfflinePay = (params: Params) => {
	return $baseApi.post(`hy-order-bills/shop-offline-pay`, params, { reject: 1 })
}
//订单列表
export const $getOrderList = (params: Params) => {
	return $baseApi.get(`hy-orders/list-of-own-member`, params)
}
//订单详情
export const $getOrderDetail = (orderId: string) => {
	return $baseApi.get(`hy-orders/get-of-own-member/${orderId}`)
}
//取消订单
export const $cancelOrder = (orderId: string) => {
	return $baseApi.post(`hy-orders/cancel-of-own-member/${orderId}`)
}

//#region 订单
//支付方式列表
export const $getPaymentList = () => {
	return $baseApi.get(`payment-configurations/list`)
}
//线上付
export const $onlinePay = (orderId: string, params: Params) => {
	return $baseApi.post(`orders/start-mini-program-pay/${orderId}`, params, { reject: 1 })
}
//#endregin
